// pages/introduce/introduce.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that=this
    app.comrequest('https://live.ipass.cc/myapi2/livephoto/lpapi.php',{num:6}).then(res=>{
      // console.log(res)
      that.setData({
        carmaps:res.hb,
        list:res.data
      })
    })
  },
  itemclick(e){
    // console.log(e.currentTarget.dataset.hdstate)
    var hdstate=e.currentTarget.dataset.hdstate
    if(hdstate==1){
      wx.navigateTo({
        url: '../index/index?url='+e.currentTarget.dataset.url+'&name='+e.currentTarget.dataset.name,
      })
    }else{
      wx.showToast({
        title: '活动未开始',
        icon:"none"
      })
    }
  },
  onShareAppMessage: function() {
    return {
      title:'上清古镇精彩瞬间',
      path:'pages/introduce/introduce',
      success:res=>{
        console.log('成功')
      },fail:res=>{
        console.log("失败")
      }
    }
  },
  onShareTimeline:function(){
      return {
          title:'上清古镇精彩瞬间',
          path:'pages/introduce/introduce',
          success:res=>{
            console.log('成功')
          },fail:res=>{
            console.log("失败")
          }
        }
  }
  
})